/*
 * @Description: 银行账户
 * 
 * @Author: rendc
 * 
 * @Date: 2025-03-03 10:19:40
 * 
 * @LastEditors: rendc
 * 
 * @LastEditTime: 2025-03-03 11:10:54
 */
public class Account {
  // 1. 将不能随意修改的属性用private修饰
  // 卡号
  private String cardNo;
  // 金额
  private double money;

  // 2. 提供公共的get/set方法 去操作属性
  public void setCardNo(String cardNo) {
    this.cardNo = cardNo;
  }

  public void setMoney(double money) {
    this.money = money;
  }

  public void setMoney1(double newMoney) {
    money = newMoney;
  }

  public String getCardNo() {
    return cardNo;
  }

  public double getMoney() {
    return money;
  }

  // 显示卡号和金额
  public void show() {
    System.out.println("卡号：" + cardNo + "，金额：" + money);
  }

  public void addMoney(double money) {
    this.money += money;
  }

  public void subMoney(double money) {
    this.money -= money;
  }

}